package org.com.yz.dubbo.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import org.com.yz.dal.dao.mapper.DepositTransactionMapper;
import org.com.yz.dal.dao.model.DepositTransaction;
import org.com.yz.dubbo.api.service.IDepositTransactionService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @ClassName DepositTransactionServiceImpl
 * @Author wzc
 * @Date 2018/7/19 14:42
 **/
@Service(version = "1.0.0")
public class DepositTransactionServiceImpl implements IDepositTransactionService {

    @Autowired
    private DepositTransactionMapper depositTransactionMapper;

    /**
     * @param
     * @Description: true：已存在 false：不存在
     * @author wzc
     * @date 2018/7/20 14:27
     */
    public Boolean isOnly(String otn, String mchNo) {
        DepositTransaction ds = new DepositTransaction( );
        ds.setMchNo(mchNo);
        ds.setOutTransNo(otn);
        List<DepositTransaction> list = depositTransactionMapper.select(ds);
        if (list.size( ) > 0) {
            return true;
        }
        return false;
    }
}
